package cn.lystudio.rohmtimeopwide_background_v11.controller.webApi;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.dev33.satoken.util.SaResult;
import cn.lystudio.rohmtimeopwide_background_v11.entity.vo.LayuiPageApiResponse;
import cn.lystudio.rohmtimeopwide_background_v11.service.AllDBTimeRecordService;
import cn.lystudio.rohmtimeopwide_background_v11.service.ShiftCapacityRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@SaCheckLogin
@RequestMapping("/webapi/excel")
@Slf4j
public class ExcelController {
	private AllDBTimeRecordService allDBTimeRecordService;

	@Autowired
	@Lazy
	public void setAllDBTimeRecordService(AllDBTimeRecordService allDBTimeRecordService) {
		this.allDBTimeRecordService = allDBTimeRecordService;
	}

	@GetMapping("/getExcelData")
	@SaIgnore
	public SaResult getExcelData(@RequestParam("selectedMachineNo")String selectedMachineNo,
	                              @RequestParam("selectedDate")String selectedDate){
		return SaResult.data(allDBTimeRecordService.getExcelDate(selectedMachineNo, selectedDate));
	}

}
